<template>
	<uni-collapse >
		<uni-collapse-item class="collapse-item-content" @thumbClick="thumbClick" :show="true" v-for="(item ,index) in highLevelInfo" :key="index" :name="index" :open="index === 0?true:false" style="margin-top: 30rpx;"  :title="item.dimensionName">
			<template v-slot:content>
				<view style="padding: 30rpx; display: flex;flex-direction: column;">
					<view v-if="item.developmentStatus" class="suggest-item-title-view">
						<view class="suggest-item-title-top"></view>
						<text class="suggest-item-title">发育里程碑:</text>
					</view>
					<view v-if="item.developmentStatus" class="suggest-item-content">{{item.developmentStatus}}</view>
					<view class="suggest--exline"></view>

					<view v-if="item.observation" class="suggest-item-title-view">
						<view class="suggest-item-title-top"></view>
						<text class="suggest-item-title">重点观察项:</text>
					</view>
					<view v-if="item.observation" class="suggest-item-title" style="margin-top: 20rpx;margin-left: 20rpx;">{{item.observation}}</view>
					<view v-if="item.observation" class="suggest--exline" style="margin-top: 40rpx;"></view>

					<view v-if="item.guide" class="suggest-item-title-view">
						<view class="suggest-item-title-top"></view>
						<text class="suggest-item-title">指导方案:</text>
					</view>
					<view v-if="item.guide" class="suggest-item-content">{{item.guide}}</view>

					<view v-if="item.bringUp" class="suggest-item-title-view">
						<view class="suggest-item-title-top"></view>
						<text class="suggest-item-title">能力拓展:</text>
					</view>
					<view v-if="item.bringUp" class="suggest-item-content">{{item.bringUp}}</view>

					<view v-if="item.parentManual" class="suggest-item-title-view">
						<view class="suggest-item-title-top"></view>
						<text class="suggest-item-title">家长手册:</text>
					</view>
					<view v-if="item.parentManual" class="suggest-item-content">{{item.parentManual}}</view>
				</view>
			</template>
		</uni-collapse-item>
		<uni-collapse-item class="collapse-item-content" title="测评项目详情" :disabled="false" style="margin-top: 30rpx;">
			<template v-slot:content>
				<view style="padding: 30rpx;padding-top: 0rpx; display: flex;flex-direction: column;">
					<answerSheet :answerSheet="answerSheet"></answerSheet>
				</view>
			</template>
		</uni-collapse-item>
	</uni-collapse>
</template>

<script>
	import answerSheet from './assess-answer-sheet'
	import utils from '@/utils/utils.js'
	import UniCollapse from '@/components/uni-collapse/uni-collapse.vue'
	import UniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
	export default {
		name: "AssessHighLevel",
		components: {
			answerSheet,
			UniCollapse,
			UniCollapseItem
		},
		props: {
			highLevelInfo: {
				type: Array,
				default() {
					return []
				}
			},
			answerSheet: {
				type: Array,
				default() {
					return []
				}
			},
			paid: {
				type: Boolean,
				default() {
					return false;
				}
			}
		},
		data() {
			return {
				appId: getApp().globalData.appid,
			};
		},
		methods: {
			thumbClick(index) {
				// if (!this.paid) {
				// 	return;
				// }
				// if (this.appId === 'wx098b4aa58f613e7b') {
				// 	return;
				// }
				// var recommendURL = this.highLevelInfo[index].recommendURL;
				// if (utils.isEmpty(recommendURL)) {
				// 	var recommendTip = this.highLevelInfo[index].recommendTips;
				// 	var confirmColor = getApp().globalData.themeColor;
				// 	uni.showModal({
				// 		title: '课程推荐',
				// 		content: recommendTip,
				// 		showCancel: false,
				// 		confirmColor: confirmColor,
				// 	});
				// } else {
				// 	uni.navigateTo({
				// 		url: '/pages-assess/web/web?url=' + recommendURL,
				// 	})
				// }
			},
		}
	}
</script>

<style lang="scss">
	.collapse-item-content {
		
	}
	
	.suggest-item-title-view {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.suggest-item-title-top {
		width: 10px;
		height: 15px;
		background-color: rgba(250, 203, 47, 1);
		opacity: 1;
		margin-right: 10rpx;
	}

	.suggest-item-title {
		font-size: 30rpx;
		font-weight: bold;
		line-height: 21px;
		color: rgba(34, 34, 34, 1);
		opacity: 1;
	}

	.suggest-item-content {
		font-size: 30rpx;
		font-weight: 400;
		color: rgba(102, 102, 102, 1);
		opacity: 1;
		margin-top: 20rpx;
		margin-bottom: 40rpx;
		margin-left: 20rpx;
	}
	
	.suggest--exline {
		border-top:1px dashed $app-main-color;
		height: 1px;
		overflow: hidden;
		margin-bottom: 40rpx;
	}
</style>
